package com.iran.singleton;

/**
 * 基础单例模式，如果是多线程去实例化，则还是有可能同时创建两个实例
 */
public class Singleton {
    private static Singleton singleton;
    private Singleton() {

    }
    public static Singleton getSingleton(){
        if (singleton == null){
            singleton = new Singleton();
        }
        return singleton;
    }
}
